@layout("/common/_container.html",{bg:"bg-white",js:["/assets/modular/system/user/form.js"]}){
<form id="userForm" lay-filter="userForm" class="layui-form model-form">
    <input name="userId" type="hidden" value="${user.userId}" />
    <input name="lesseeId" type="hidden" value="${user.lesseeId}"/>
    <input name="deptId" type="hidden" value="${user.deptId}"/>


    <div class="layui-form-item">
        <label class="layui-form-label">登录账号<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="account" placeholder="必须唯一。建议使用Email邮箱/手机号/名字拼音" type="text" class="layui-input" 
            lay-verify="required|account"
            autocomplete="off"
            maxlength="50" 
            @if(isNotEmpty(user.userId)){
            readonly="readonly"
            @}
            value="${user.account}" required/>

        </div>

    </div>

    @if(isEmpty(user.userId)){
    <div class="layui-form-item">
        <label class="layui-form-label">初始密码<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="password" placeholder="请输入初始密码6~16位" type="text" class="layui-input"  value="${user.password}"
                   lay-verify="required|psw" required
                   maxlength="16"  autocomplete="off"/>
        </div>
    </div>
    @}

    
    <div class="layui-form-item">
        <label class="layui-form-label">姓名<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input name="userName" placeholder="请输入姓名" type="text" class="layui-input" lay-verify="required" value="${user.userName}" maxlength="64" required autocomplete="off"/>
        </div>
    </div>





    <div class="layui-form-item">
        <label class="layui-form-label">部门<span style="color: red;">*</span></label>
        <div class="layui-input-block">
            <input id="deptName" name="deptName" placeholder="请选择部门" type="text" class="layui-input" lay-verify="required" required autocomplete="off" value="${user.deptName}" />
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">邮箱<i lay-tips="密码被管理员重置时，新的密码将发送至该邮箱地址。" lay-direction="1" class="layui-icon layui-icon-tips"></i>&nbsp;</label>
        <div class="layui-input-block">
            <input name="email" placeholder="请输入有效的邮箱地址" type="text" class="layui-input"  autocomplete="off"
                   value="${user.email}" lay-verify="email_none"
            />

        </div>
    </div>

     <div class="layui-form-item">
        <label class="layui-form-label">昵称</label>
        <div class="layui-input-block">
            <input name="nickName" placeholder="请输入昵称" type="text" class="layui-input" value="${user.nickName}" autocomplete="off"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">出生日期</label>
        <div class="layui-input-block">
            <input id="birthday" name="birthday" placeholder="请输入生日" type="text" class="layui-input" autocomplete="off" value="${user.birthday}" maxlength="10" autocomplete="off" />
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <input type="radio" name="sex" value="M" title="男" ${user.sex=='M'?'checked':''}/>
            <input type="radio" name="sex" value="F" title="女" ${user.sex=='F'?'checked':''}/>
        </div>
    </div>
    
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-block">
            <input name="mobile" placeholder="请输入联系电话" type="text" class="layui-input" value="${user.mobile}" autocomplete="off"/>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="checkbox"  ${user.status==1?'checked':''} name="status" lay-skin="switch" lay-filter="status"  lay-text="启用|冻结">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <input name="memo" placeholder="用户备注信息" type="text" class="layui-input"  autocomplete="off"
                   value="${user.memo}" maxlength="150"
            />

        </div>
    </div>


    <div class="layui-form-item text-right">

        <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
        <button class="layui-btn" lay-filter="btnSubmit" lay-submit>保存</button>
    </div>
</form>
@}
